


var Pice = React.createClass({
	chu:function(){
		$(".car_goods_bom").animate({bottom:0},500,function(){
			$(".zhegai").css({display:"block"})
		})
	},
	render : function(){
		return (
			<div className="goods_pj_top">
				<h3>{this.props.data.goods_name}</h3>
				<p>
					<span><b>¥</b>{this.props.data.goods_price}</span>
					<span>
						销量:<b>{this.props.data.goods_salenum}</b>份 · 库存:<b>{this.props.data.goods_storage}</b>
					</span>
				</p>
				<section>
					<div>
						<a href="javascript:;">已选</a>
						<a href="javascript:;" className="aactive">默认</a>
					</div>
					<i className="iconfont goods_pj_btn_r icon-qianjin" onClick={this.chu}></i>
				</section>
			</div>
		)
	}
})

var Bengkui = React.createClass({
	render : function(){
		return (
			<div className="bengkuile">
				<div className="wx">
					 <a className="iconfont tt_btn icon-pingjia"></a>
					 <a className="iconfont tt_btn icon-pingjia"></a>
					 <a className="iconfont tt_btn icon-pingjia"></a>
					 <a className="iconfont tt_btn icon-pingjia"></a>
					 <a className="iconfont tt_btn icon-pingjia"></a>
					 <p>
					 	<span>{this.props.data.geval_frommembername}</span>
					 	<span>{this.props.data.geval_addtime_date} </span>
					 </p>
					 <div className="goods_pl_le">
					 	 {this.props.data.geval_content}
					 </div>
				</div>
			</div>
		)
	}
})
 

var Nei = React.createClass({
	render : function(){
		return (
			<div className="goods_name_list">
				<div className="goods_name_list_top">
					全部评论>>好评率98%
					<p>(已有141人评论)<a href="javascript:;" className="iconfont icon-qianjin caca_btn"></a></p>
				</div> 
			</div>
		)
	}
})

export default React.createClass({
	componentWillMount:function(){  
		var shi = location.hash.indexOf("?")+10
		var mo = location.hash.indexOf("&") 
		var goodsid = location.hash.slice(shi,mo)
		//var goodsid = this.props.params.goodsId; 
		var url =  "http://www.chawo.com/mobile/index.php?act=goods&op=goods_body&goods_id="+goodsid
 		$.ajax({  
            url: url,  
            dataType: 'html',  
            success: function (data) {  
              $("#ajax_html").append($(data));//包装数据
            }  
         });  
	},
	render : function(){
		var obj = this.props.data.goods_eval_list.map(function(data,index){
		return <Bengkui data={data}  key={index}/>
	}) 
		return ( 
				<div className="goods_pj_top1">
					<Pice data={this.props.data}/>	
					<Nei/>
					{obj}
					<div id="ajax_html"></div>
				</div>
				
		)
	}
})
